Skip to content

Feat: Add paginated offline player list command - #6654

Open
Drippyz1 wants to merge 3 commits into
EssentialsX:2.xfrom
Drippyz1:feature/offline-player-list
Open

Drippyz1 wants to merge 3 commits into
EssentialsX:2.xfrom
Drippyz1:feature/offline-player-list

Conversation

@Drippyz1

@Drippyz1 Drippyz1 commented Dec 2, 2026

Copy link
Copy Markdown

Information

This PR closes #6264.

Details

Proposed feature:

Introduces /offlineplayers [page], allowing administrators to view a paginated list of offline players stored in EssentialsX.

The implementation includes:

  • Player usernames, UUIDs, and last-seen information.
  • Alphabetical sorting with 10 players per page.
  • Permission control through essentials.offlineplayers.
  • Exclusion of online players and NPCs.
  • Asynchronous player-data retrieval.
  • A 30-second cache to reduce repeated storage lookups.
  • Cache invalidation on player joins, disconnects, and EssentialsX reloads.
  • Synchronized cache state and generation-based protection against outdated scan results.
  • Protection against concurrent list generation.
  • Localizable command messages.

IP addresses are intentionally excluded for privacy reasons.

Environments tested:

OS: macOS (Apple Silicon)

Java version: 21.0.12.1

  • Paper 1.21.11 (build 132)
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8

Demonstration:

Commands:

  • /offlineplayers
  • /offlineplayers 2
  • /eofflineplayers

The implementation was tested locally for pagination, sorting, permissions, invalid arguments, NPC exclusion, online player exclusion, cache expiration, and cache invalidation.

The caching revision was also stress-tested with 10,000 synthetic offline player records:

  • Initial retrieval: approximately 4 seconds.
  • Subsequent cached requests: under 1 second.
  • Observed TPS averages: 20.0.

The final revision successfully passed the Gradle build and includes 14 feature-specific automated tests.

I have reused existing EssentialsX APIs and implementation patterns wherever possible. Feedback regarding asynchronous user-storage access and compatibility with older server versions would be particularly appreciated, as these have not been fully verified across all supported environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

List of Offline Players

1 participant